var express = require("express");
var app = express();
app.all("*",function (req,res,next) {
	res.header("Access-Control-Allow-Origin","*");
	next();
})
app.get("/",function (req,res) {
	res.sendFile(__dirname+"/index.html");
})
app.get("/list",function (req,res) {
	//__dirname 当前服务所在的路径
	var username =req.query.username;
	console.log(username);
	var psd = req.query.password;
	if (username=="admin"&&psd=="123456") {
		res.sendFile(__dirname+"/success.html");
	}else{
		res.sendFile(__dirname+"/fail.html");
	}
})

app.listen(8888,function (argument) {
	console.log("服务已启动,端口号8888")
})